package com.hmall.order;

import com.hmall.interceptor.FeignClientInterceptor;
import com.hmall.feign.client.ItemClient;
import com.hmall.feign.client.UserClient;
import com.hmall.feign.config.OpenFeignLoggerConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@MapperScan("com.hmall.order.mapper")
@SpringBootApplication
@EnableFeignClients(clients = {ItemClient.class, UserClient.class}, defaultConfiguration = OpenFeignLoggerConfiguration.class)
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
        System.out.println("order-service启动成功");
    }

    @Bean
    public FeignClientInterceptor feignClientInterceptor(){
        return new FeignClientInterceptor();
    }
}